﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using DnD.ViewModels;
using DnD.Model;

namespace DnD
{
    public partial class BrowsePage : PhoneApplicationPage
    {
        public BrowsePage()
        {
            InitializeComponent();
            DataContext = new BrowseViewModel(this);
        }

        private void LocalCardList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ((BrowseViewModel)DataContext).SelectedLocalCard = ((LongListSelector)sender).SelectedItem as Card;
        }

        private void OnlineCardList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ((BrowseViewModel)DataContext).SelectedOnlineCard = ((LongListSelector)sender).SelectedItem as Card;
        }

        private void MyCardList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ((BrowseViewModel)DataContext).SelectedMyCard = ((LongListSelector)sender).SelectedItem as Card;
        }
    }
}